<template>
	<view class="mes" @click="showdetail">
		<img :src="pic" alt="" class="headimg" />
		<view>
			<h2 class="title">{{title}}</h2>
			<view class="content">
				{{Content}}
			</view>
			<view class="timeAndType">
				<view class="time">
					{{time.substring(0,10)}}
				</view>
				<view class="type">
					<view class="action">
						<view class="cu-tag round bg-orange light">{{types}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {truncateString} from '@/store/constants.js'
	export default{
		props: ['title', 'pic', 'content','id','time','types'],
		mounted() {
			this.Content=truncateString(this.content)
		},
		data(){
			return{
				Content:''
			}
		},
		methods: {
			showdetail() {
				console.log(this.id)
				uni.navigateTo({
					url: `/subpkg/mes_detail/mes_detail?id=${this.id}`
				})
			}
		}
	}
	
</script>

<style scoped lang="less">
	.timeAndType {
		display: flex;
		font-size: 10px;
		justify-content: flex-end;
		align-items: center;
		margin-right: 2vw;
	}
	.time {
		margin-right: 4vw;
	}
	
	.meslist {
		position: relative;
		z-index: 1;
		// margin-block-start: 20rpx;
		padding: 18rpx;
	}
	
	/* 单个卡片 */
	.mes {
		z-index: 5;
		display: flex;
		margin-top: 32rpx;
		// height: 20vh;
		border-radius: 10rpx;
		// align-items: center;
		padding-top: 2vh;
		box-shadow: 3px 3px 5px 3px #888888;
		background-color: #fefefe;
	}
	
	.headimg {
		width: 200rpx;
		height: 100rpx;
		border-radius: 75%;
		margin-left: 15rpx;
		background-color: aliceblue;
	}
	
	.content {
		width: 620rpx;
		font-size: 25rpx;
		-webkit-line-clamp: 2;
		margin-left: 15rpx;
	}
	
	.title {
		font-weight: 700;
		font-size: 30rpx;
		margin-left: 15rpx;
	}
	
	.bg {
		width: 100%;
		height: 74%;
		z-index: 0;
		position: absolute;
	}
	
</style>